package com.zjmzxfzhl.modules.app.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zjmzxfzhl.common.core.base.BaseEntity;
import com.zjmzxfzhl.common.core.validator.constraints.LengthForUtf8;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

import com.zjmzxfzhl.modules.app.form.DocFilePath;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 【】实体类
 * 
 * @author 张森荣
 */
@Data
@TableName("T_APP_MODI")
public class AppModi extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId
//    @NotNull
    @LengthForUtf8(max = 32)
    private String modiId;

    /**
     * 变更类型
     */
    @NotNull
    @LengthForUtf8(max = 2)
    private String modiType;

    /**
     * 变更类型ID
     */
    @NotNull
    @LengthForUtf8(max = 32)
    private String modiTypeId;

    /**
     * 变更说明
     */
//    @NotNull
    private String content;

    /**
     * 流程ID
     */
    @LengthForUtf8(max = 64)
    private String modelId;

    /**
     * 表单Key
     */
//    @NotNull
    @LengthForUtf8(max = 100)
    private String formKey;

    /**
     * 表单数据
     */
    private String formData;

    /**
     * 状态
     */
    @NotNull
    @LengthForUtf8(max = 2)
    private String status;

    /**
     * 变更二级类型
     */
//    @NotNull
    @LengthForUtf8(max = 2)
    private String modiSubtype;

    /**
     * 目录ID
     */
//    @NotNull
    @LengthForUtf8(max = 64)
    private String processInstanceId;

    /**
     * 添加时传入附件
     */
    @TableField(exist = false)
    private List<DocFilePath> docFilePath= new ArrayList<>();

    /**
     * 变更前开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date oldStartDate;

    /**
     * 变更前结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date oldEndDate;

    /**
     * 实际开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date workStartDate;

    /**
     * 实际完成日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date workEndDate;

    /**
     * 原实际完成工时
     */
    @Max(9999L)
    private Integer oldWorkTime;
}